Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TweenMgr = undefined;
var exp_TweenMgr = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
  }
  return babel_createClass(_ctor, [{
    key: "blink",
    value: function blink(e) {
      cc.tween(e).to(.03, {
        opacity: 0
      }).to(.03, {
        opacity: 255
      }).to(.03, {
        opacity: 0
      }).to(.03, {
        opacity: 255
      }).to(.03, {
        opacity: 0
      }).to(.03, {
        opacity: 255
      }).start();
    }
  }, {
    key: "swing",
    value: function swing(e) {
      cc.tween(e).to(.06, {
        angle: 15
      }).to(.12, {
        angle: -15
      }).to(.12, {
        angle: 15
      }).to(.12, {
        angle: -15
      }).to(.06, {
        angle: 0
      }).start();
    }
  }, {
    key: "swingRepeat",
    value: function swingRepeat(e, t) {
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .2;
      var _o102 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 15;
      var i = arguments.length > 4 ? arguments[4] : undefined;
      e.initangle || (e.initangle = e.angle);
      cc.tween(e).sequence(cc.tween().to(n, {
        angle: e.initangle + _o102
      }), cc.tween().to(n, {
        angle: e.initangle - _o102
      })).repeat(t).to(n / 2, {
        angle: 0
      }).call(function () {
        i && i();
      }).start();
    }
  }, {
    key: "huaixiao",
    value: function huaixiao(e) {
      e.inity || (e.inity = e.y);
      cc.tween(e).to(.03, {
        y: e.inity + 5
      }).to(.06, {
        y: e.inity - 5
      }).to(.06, {
        y: e.inity + 5
      }).to(.06, {
        y: e.inity - 5
      }).to(.06, {
        y: e.inity + 5
      }).to(.06, {
        y: e.inity - 5
      }).to(.06, {
        y: e.inity + 5
      }).to(.06, {
        y: e.inity - 5
      }).to(.06, {
        y: e.inity + 5
      }).to(.03, {
        y: e.inity
      }).start();
    }
  }, {
    key: "stop",
    value: function stop(e) {
      cc.Tween.stopAllByTarget(e);
    }
  }, {
    key: "scaleIn",
    value: function scaleIn(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
      var _o103 = arguments.length > 3 ? arguments[3] : undefined;
      cc.tween(e).to(t, {
        scale: n
      }).call(function () {
        _o103 && _o103();
      }).start();
    }
  }, {
    key: "scaleX",
    value: function scaleX(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
      var _o104 = arguments.length > 3 ? arguments[3] : undefined;
      cc.tween(e).to(t, {
        scaleX: n
      }).call(function () {
        _o104 && _o104();
      }).start();
    }
  }, {
    key: "scaleBack",
    value: function scaleBack(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .8;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.5;
      var _o105 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : .5;
      var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
      cc.tween(e).to(t, {
        scale: n
      }).to(_o105, {
        scale: i
      }).start();
    }
  }, {
    key: "fadeIn",
    value: function fadeIn(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 255;
      var _o106 = arguments.length > 3 ? arguments[3] : undefined;
      cc.tween(e).to(t, {
        opacity: n
      }).call(function () {
        _o106 && _o106();
      }).start();
    }
  }, {
    key: "moveto",
    value: function moveto(e, t) {
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 900;
      var _o107 = arguments.length > 3 ? arguments[3] : undefined;
      var i = e.getPosition().sub(t).mag() / n;
      cc.tween(e).to(i, {
        position: cc.v3(t.x, t.y)
      }).call(function () {
        _o107 && _o107();
      }).start();
      return i;
    }
  }, {
    key: "childeOpen",
    value: function childeOpen(e, t) {
      cc.tween(e.children[0]).to(.5, {
        angle: 90
      }).call(function () {
        t && t();
      }).start();
      cc.tween(e.children[1]).to(.5, {
        angle: -90
      }).start();
    }
  }, {
    key: "movetoTime",
    value: function movetoTime(e, t) {
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
      var _o108 = arguments.length > 3 ? arguments[3] : undefined;
      cc.tween(e).to(n, {
        position: cc.v3(t.x, t.y)
      }).call(function () {
        _o108 && _o108();
      }).start();
    }
  }, {
    key: "rotateto",
    value: function rotateto(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
      var _o109 = arguments.length > 3 ? arguments[3] : undefined;
      cc.tween(e).to(t, {
        angle: n
      }).call(function () {
        _o109 && _o109();
      }).start();
    }
  }, {
    key: "shake",
    value: function shake(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6;
      var _o110 = arguments.length > 3 ? arguments[3] : undefined;
      cc.tween(e).sequence(cc.tween().by(.05, {
        y: n
      }), cc.tween().by(.05, {
        y: -n
      })).repeat(t).call(function () {
        _o110 && _o110();
      }).start();
    }
  }, {
    key: "shakeScale",
    value: function shakeScale(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.1;
      var _o111 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : .2;
      var i = arguments.length > 4 ? arguments[4] : undefined;
      e.initscale || (e.initscale = e.scale);
      e.scale = e.initscale;
      cc.Tween.stopAllByTag(99);
      cc.tween(e).sequence(cc.tween().to(n, {
        scale: e.initscale + _o111
      }), cc.tween().to(n, {
        scale: e.initscale
      })).repeat(t).call(function () {
        i && i();
      }).tag(99).start();
    }
  }, {
    key: "breathing",
    value: function breathing(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .06;
      e.initscale || (e.initscale = e.scale);
      cc.Tween.stopAllByTarget(e);
      cc.tween(e).sequence(cc.tween().to(t, {
        scale: e.initscale + n
      }), cc.tween().to(t, {
        scale: e.initscale
      })).repeatForever().start();
    }
  }], [{
    key: "Inst",
    get() {
      null == this.instance && (this.instance = new _ctor());
      return this.instance;
    }
  }]);
}();
exports.TweenMgr = exp_TweenMgr;
exp_TweenMgr.instance = null;